<div class="paylog">

<h3><{"Detail"|msg}></h3>

<{include file="db:`$paylog.dirname`.tab_menu.tpl"}>

<form action="#" method="get" class="dateNavi">
<input type="hidden" name="controller" value="detail" />
<input type="hidden" name="book_id" value="<{$paylog.book_id}>" />
<input type="text" name="start" value="<{$paylog.start}>" size="10" maxlength="10" />
-
<input type="text" name="end" value="<{$paylog.end}>" size="10" maxlength="10" />
<input type="submit" value="<{"Submit"|msg}>" class="minibutton icon search" />
</form>

<table class="outer">

<tr>
<th><{"ID"|msg}></th>
<th><{"Date"|msg}></th>
<th><{"Item"|msg}></th>
<th><{"Price"|msg}></th>
<{foreach from=$paylog.groups item="group"}>
<th><{$group.name}></th>
<{/foreach}>
<th><{"Operate"|msg}></th>
</tr>

<{foreach from=$paylog.items item="item"}>
<tr class="<{cycle values="odd,even"}>">
<td class="alignRight"><{$item.id}></td>
<td class="center"><{$item.date|date_format:$paylog.date_format}></td>
<td><{$item.name}></td>
<td class="alignRight">
<{if $item.income}>
+<{$item.income}>
<{else}>
-<{$item.outgo}>
<{/if}>
</td>
<{foreach from=$paylog.groups item="group"}>
<td class="center">
<{$item.tags[$group.id].name}>
</td>
<{/foreach}>
<td>
<a href="<{url controller="edit_balance" balance_id=$item.id}>"><{"Edit"|msg}></a>
<a href="<{url controller="delete_balance" balance_id=$item.id}>"><{"Delete"|msg}></a>
</td>
</tr>
<{/foreach}>

<tr class="foot">
<td></td>
<td></td>
<td class="center"><{"Sum"|msg}></td>
<td class="alignRight">
<{if $paylog.outgo_total}>
-<{$paylog.outgo_total}>
<{/if}>
<{if $paylog.outgo_total && $paylog.income_total}>
<br />
<{/if}>
<{if $paylog.income_total}>
+<{$paylog.income_total}>
<{/if}>
</td>
<{foreach from=$paylog.groups item="group"}>
<td></td>
<{/foreach}>
<td>
</tr>

</table>

</div>